#coding:utf-8
import pyodbc
connection = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=PACS70D;UID=sa;PWD=sa')
cur=connection.cursor()
cur.execute("""
               select PatientID, PatientName
               from T_PATIENT  
            """)
i=0
for row in cur:
	i+=1
	print 'PatientID  :',row.PatientID,'\t','PatientName:',row.PatientName
print 'T_PATIENT   count:  ',i

cur.execute("""
               select PatientName
               from T_QUEUE 
            """)
i=0
for row in cur:
	i+=1
	print 'PatientName:',row.PatientName
print 'T_QUEUE   count:  ',i

raw_input(u'请按回车键结束'.encode('gbk'))